#include "CLogger.h"

CLogger* CLogger::pLogger = new CLogger();

CLogger::CLogger() { 
	if(!CLogger::mFile.is_open())  {
		CLogger::mFile.open("log.txt", std::ofstream::app);
	}
}

CLogger::~CLogger() { 
	if(CLogger::mFile.is_open())  {
		CLogger::mFile.close();
	}
}

void CLogger::Log(char* message1, char* message2) {
	CLogger::mFile << "*-----------------------------------------------------------------------------*\n";
	CLogger::mFile << "*-                       STARTING WRITING LOG                                -*\n";
	CLogger::mFile << "*-----------------------------------------------------------------------------*\n";
	CLogger::mFile << "*                                                                             *\n"; 
	CLogger::mFile << "* " << message1 << "\n";
	CLogger::mFile << "* " << message2 << "\n";
	CLogger::mFile << "*                                                                             *\n"; 
	CLogger::mFile << "*-----------------------------------------------------------------------------*\n";
	CLogger::mFile << "*-                       STOPPING WRITING LOG                                -*\n";
	CLogger::mFile << "*-----------------------------------------------------------------------------*\n";
}